+2001-01-15 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkdrawable-fb2.c:
+ For optization, add an full_shapes argument to gdk_fb_clip_region.
+ If this is false, only the cliprects of the shapes are used.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Export gdk_fb_window_peek_shape.
+ Add full_shapes to gdk_fb_clip_region.
+
+ * gdk/linux-fb/gdkwindow-fb.c (gdk_fb_window_move_resize):
+ When moving a window, don't clear everything under the it, just the
+ root window. Makes stuff faster and flash less.
+ (gdk_window_get_pointer): Correctly handle offseted shapes, due to
+ USE_CHILD_SHAPE. (gdk_fb_window_peek_shape): Return the correct
+ offset of the shape.
+
+
2001-01-12 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): offset the
+2001-01-15 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkdrawable-fb2.c:
+ For optization, add an full_shapes argument to gdk_fb_clip_region.
+ If this is false, only the cliprects of the shapes are used.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Export gdk_fb_window_peek_shape.
+ Add full_shapes to gdk_fb_clip_region.
+
+ * gdk/linux-fb/gdkwindow-fb.c (gdk_fb_window_move_resize):
+ When moving a window, don't clear everything under the it, just the
+ root window. Makes stuff faster and flash less.
+ (gdk_window_get_pointer): Correctly handle offseted shapes, due to
+ USE_CHILD_SHAPE. (gdk_fb_window_peek_shape): Return the correct
+ offset of the shape.
+
+
2001-01-12 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): offset the
+2001-01-15 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkdrawable-fb2.c:
+ For optization, add an full_shapes argument to gdk_fb_clip_region.
+ If this is false, only the cliprects of the shapes are used.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Export gdk_fb_window_peek_shape.
+ Add full_shapes to gdk_fb_clip_region.
+
+ * gdk/linux-fb/gdkwindow-fb.c (gdk_fb_window_move_resize):
+ When moving a window, don't clear everything under the it, just the
+ root window. Makes stuff faster and flash less.
+ (gdk_window_get_pointer): Correctly handle offseted shapes, due to
+ USE_CHILD_SHAPE. (gdk_fb_window_peek_shape): Return the correct
+ offset of the shape.
+
+
2001-01-12 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): offset the
+2001-01-15 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkdrawable-fb2.c:
+ For optization, add an full_shapes argument to gdk_fb_clip_region.
+ If this is false, only the cliprects of the shapes are used.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Export gdk_fb_window_peek_shape.
+ Add full_shapes to gdk_fb_clip_region.
+
+ * gdk/linux-fb/gdkwindow-fb.c (gdk_fb_window_move_resize):
+ When moving a window, don't clear everything under the it, just the
+ root window. Makes stuff faster and flash less.
+ (gdk_window_get_pointer): Correctly handle offseted shapes, due to
+ USE_CHILD_SHAPE. (gdk_fb_window_peek_shape): Return the correct
+ offset of the shape.
+
+
2001-01-12 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): offset the
+2001-01-15 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkdrawable-fb2.c:
+ For optization, add an full_shapes argument to gdk_fb_clip_region.
+ If this is false, only the cliprects of the shapes are used.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Export gdk_fb_window_peek_shape.
+ Add full_shapes to gdk_fb_clip_region.
+
+ * gdk/linux-fb/gdkwindow-fb.c (gdk_fb_window_move_resize):
+ When moving a window, don't clear everything under the it, just the
+ root window. Makes stuff faster and flash less.
+ (gdk_window_get_pointer): Correctly handle offseted shapes, due to
+ USE_CHILD_SHAPE. (gdk_fb_window_peek_shape): Return the correct
+ offset of the shape.
+
+
2001-01-12 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): offset the
+2001-01-15 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkdrawable-fb2.c:
+ For optization, add an full_shapes argument to gdk_fb_clip_region.
+ If this is false, only the cliprects of the shapes are used.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Export gdk_fb_window_peek_shape.
+ Add full_shapes to gdk_fb_clip_region.
+
+ * gdk/linux-fb/gdkwindow-fb.c (gdk_fb_window_move_resize):
+ When moving a window, don't clear everything under the it, just the
+ root window. Makes stuff faster and flash less.
+ (gdk_window_get_pointer): Correctly handle offseted shapes, due to
+ USE_CHILD_SHAPE. (gdk_fb_window_peek_shape): Return the correct
+ offset of the shape.
+
+
2001-01-12 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): offset the
+2001-01-15 Alexander Larsson <alexl@redhat.com>
+
+ * gdk/linux-fb/gdkdrawable-fb2.c:
+ For optization, add an full_shapes argument to gdk_fb_clip_region.
+ If this is false, only the cliprects of the shapes are used.
+
+ * gdk/linux-fb/gdkprivate-fb.h:
+ Export gdk_fb_window_peek_shape.
+ Add full_shapes to gdk_fb_clip_region.
+
+ * gdk/linux-fb/gdkwindow-fb.c (gdk_fb_window_move_resize):
+ When moving a window, don't clear everything under the it, just the
+ root window. Makes stuff faster and flash less.
+ (gdk_window_get_pointer): Correctly handle offseted shapes, due to
+ USE_CHILD_SHAPE. (gdk_fb_window_peek_shape): Return the correct
+ offset of the shape.
+
+
2001-01-12 Havoc Pennington <hp@redhat.com>
* gdk/x11/gdkgeometry-x11.c (gdk_window_scroll): offset the
gdk_fb_clip_region (GdkDrawable *drawable,
GdkGC *gc,
gboolean do_clipping,
- gboolean do_children)
+ gboolean do_children,
+ gboolean full_shapes)
{
GdkRectangle draw_rect;
GdkRegion *real_clip_region, *tmpreg, *shape;
parent = GDK_WINDOW_P (private->wrapper);
while (parent != (GdkWindowObject *)gdk_parent_root)
{
- shape = gdk_fb_window_get_abs_shape (GDK_DRAWABLE (parent));
- if (shape)
+ if (full_shapes)
{
- gdk_region_intersect (real_clip_region, shape);
- gdk_region_destroy (shape);
+ shape = gdk_fb_window_get_abs_shape (GDK_DRAWABLE (parent));
+ if (shape)
+ {
+ gdk_region_intersect (real_clip_region, shape);
+ gdk_region_destroy (shape);
+ }
+ }
+ else
+ {
+ gint dx, dy;
+ shape = gdk_fb_window_peek_shape (GDK_DRAWABLE (parent), &dx, &dy);
+ if (shape)
+ {
+ GdkRectangle rect;
+ GdkRegion *reg;
+
+ gdk_region_get_clipbox (shape, &rect);
+
+ rect.x += GDK_DRAWABLE_IMPL_FBDATA (parent)->abs_x + dx;
+ rect.y += GDK_DRAWABLE_IMPL_FBDATA (parent)->abs_y + dy;
+
+ reg = gdk_region_rectangle(&rect);
+ gdk_region_intersect (real_clip_region, reg);
+ gdk_region_destroy (reg);
+ }
+
}
parent = parent->parent;
}
else
gdk_color_black (private->colormap, &info.color);
- real_clip_region = gdk_fb_clip_region (drawable, gc, TRUE, GDK_GC_FBDATA (gc)->values.function != GDK_INVERT);
+ real_clip_region = gdk_fb_clip_region (drawable, gc, TRUE, GDK_GC_FBDATA (gc)->values.function != GDK_INVERT, TRUE);
if (private->mem == GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->mem &&
gdk_fb_cursor_region_need_hide (real_clip_region))
dc->clipxoff = - private->abs_x;
dc->clipyoff = - private->abs_y;
- dc->real_clip_region = gdk_fb_clip_region (drawable, gc, do_clipping, TRUE);
+ dc->real_clip_region = gdk_fb_clip_region (drawable, gc, do_clipping, TRUE, TRUE);
if (gc)
{
else
gdk_color_black (private->colormap, &color);
- real_clip_region = gdk_fb_clip_region (drawable, gc, TRUE, GDK_GC_FBDATA (gc)->values.function != GDK_INVERT);
+ real_clip_region = gdk_fb_clip_region (drawable, gc, TRUE, GDK_GC_FBDATA (gc)->values.function != GDK_INVERT, TRUE);
if (private->mem == GDK_DRAWABLE_IMPL_FBDATA (gdk_parent_root)->mem &&
gdk_fb_cursor_region_need_hide (real_clip_region))
gint height,
gboolean send_expose_events);
GdkWindow *gdk_fb_window_find_focus (void);
-GdkRegion *gdk_fb_window_get_abs_shape (GdkDrawable *window);
+GdkRegion *gdk_fb_window_get_abs_shape (GdkDrawable *window);
+GdkRegion *gdk_fb_window_peek_shape (GdkDrawable *window,
+ gint *dx,
+ gint *dy);
GdkGC * _gdk_fb_gc_new (GdkDrawable *drawable,
GdkGCValues *values,
GdkGCValuesMask values_mask);
GdkRegion *gdk_fb_clip_region (GdkDrawable *drawable,
GdkGC *gc,
gboolean do_clipping,
- gboolean do_children);
+ gboolean do_children,
+ gboolean full_shapes);
GdkGrabStatus gdk_fb_pointer_grab (GdkWindow *window,
static void recompute_drawable (GdkDrawable *drawable);
static void gdk_fb_window_raise (GdkWindow *window);
static GdkRegion* gdk_window_fb_get_visible_region (GdkDrawable *drawable);
-static GdkRegion *gdk_fb_window_peek_shape (GdkDrawable *window);
typedef struct
{
gint i, draw_dir;
GdkEvent *event;
GdkWindow *mousewin;
+ GdkRectangle root_rect;
+ GdkRectangle update_rect;
g_return_if_fail (window != NULL);
g_return_if_fail (GDK_IS_WINDOW (window));
send_expose_events = FALSE;
if (private->mapped && send_expose_events)
- old_region = gdk_fb_clip_region (GDK_DRAWABLE_IMPL(window), NULL, TRUE, FALSE);
+
+ old_region = gdk_fb_clip_region (GDK_DRAWABLE_IMPL(window), NULL, TRUE, FALSE, FALSE);
dx = x - private->x;
dy = y - private->y;
GdkRegion *new_region, *region;
gboolean handle_cursor = FALSE;
- new_region = gdk_fb_clip_region (GDK_DRAWABLE_IMPL (window), NULL, TRUE, FALSE);
+ new_region = gdk_fb_clip_region (GDK_DRAWABLE_IMPL (window), NULL, TRUE, FALSE, TRUE);
region = gdk_region_copy (old_region);
gdk_region_offset (region, dx, dy);
gdk_region_subtract (new_region, region);
gdk_region_destroy (region);
- gdk_window_invalidate_region_clear (gdk_parent_root, new_region);
+
+ /* Clear the root window in new_region */
+ root_rect.x = 0;
+ root_rect.y = 0;
+ root_rect.width = gdk_screen_width();
+ root_rect.height = gdk_screen_height();
+ gdk_region_get_clipbox (new_region, &update_rect);
+ if (gdk_rectangle_intersect (&update_rect, &root_rect, &update_rect))
+ gdk_window_clear_area (gdk_parent_root,
+ update_rect.x,
+ update_rect.y,
+ update_rect.width,
+ update_rect.height);
+ /* Invalidate regions in new_region */
+ gdk_window_invalidate_region (gdk_parent_root, new_region, TRUE);
+
if (handle_cursor)
gdk_fb_cursor_unhide ();
int winx = 0;
int winy = 0;
int x_int, y_int;
+ gint shape_dx, shape_dy;
GdkModifierType my_mask;
GdkRegion *shape;
return_val = NULL;
- shape = gdk_fb_window_peek_shape (window);
+ shape = gdk_fb_window_peek_shape (window, &shape_dx, &shape_dy);
if ((winx >= 0) && (winx < GDK_DRAWABLE_IMPL_FBDATA (window)->width) &&
(winy >= 0) && (winy < GDK_DRAWABLE_IMPL_FBDATA (window)->height) &&
- (!shape || gdk_region_point_in (shape, winx, winy)))
+ (!shape || gdk_region_point_in (shape, winx - shape_dx, winy - shape_dy)))
{
GdkWindowObject *private;
GdkWindowObject *sub;
if (!sub->mapped)
continue;
- shape = gdk_fb_window_peek_shape (GDK_WINDOW (sub));
+ shape = gdk_fb_window_peek_shape (GDK_WINDOW (sub),
+ &shape_dx, &shape_dy);
if (subx >= sub->x &&
(subx < (GDK_DRAWABLE_IMPL_FBDATA (sub)->width + sub->x)) &&
(suby >= sub->y) &&
(suby < (GDK_DRAWABLE_IMPL_FBDATA (sub)->height + sub->y)) &&
- (!shape || gdk_region_point_in (shape, subx - sub->x, suby - sub->y)))
+ (!shape || gdk_region_point_in (shape, subx - sub->x - shape_dx, suby - sub->y - shape_dy)))
{
subx -= sub->x;
suby -= sub->y;
return region;
}
-static GdkRegion *
-gdk_fb_window_peek_shape (GdkDrawable *window)
+GdkRegion *
+gdk_fb_window_peek_shape (GdkDrawable *window, gint *dx, gint *dy)
{
+ gint x, y;
+
if (!GDK_IS_WINDOW (window))
return NULL;
if (GDK_WINDOW_IMPL_FBDATA (window)->shape == NULL)
return NULL;
+
+ x = y = 0;
- if (GDK_WINDOW_IMPL_FBDATA (window)->shape == GDK_FB_USE_CHILD_SHAPE)
+ while (GDK_WINDOW_IMPL_FBDATA (window)->shape == GDK_FB_USE_CHILD_SHAPE)
{
GList *children;
children = ((GdkWindowObject*)window)->children;
if (children)
- return gdk_fb_window_peek_shape ((GdkDrawable *)children->data);
+ {
+ window = (GdkDrawable *)children->data;
+ x += GDK_WINDOW_P(window)->x;
+ y += GDK_WINDOW_P(window)->y;
+ }
else
return NULL;
}
+ *dx = x;
+ *dy = y;
+
return GDK_WINDOW_IMPL_FBDATA (window)->shape;
}
GdkRegion *